<?php

/**
 * EmsComment form.
 *
 * @package    ems1
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class EmsCommentForm extends BaseEmsCommentForm
{
  public function configure()
  {
      unset ($this['created_at'],$this['updated_at'],$this['content_id'],$this['approved'],$this['is_enabled']);

      $this->setWidget('comment', new sfWidgetFormTextarea(array(),array(
          'rows'=>3,
          'cols'=>20,
          'style' => 'width: auto; height: auto'
          )));
      
      $this->validatorSchema['comment'] = new sfValidatorString(
              array('trim' => true, 'min_length' => 4, 'max_length' => 255),
              array(
                  'max_length' => "El comentario excede el máximo de 255 carácteres.",
                  'min_length' => "El comentario debe tener al menos 4 caracteres",
                  'required'   => "No puede enviar un comentario vacio."
              ));

      $this->widgetSchema->setHelp('comment', 'Máximo de caracteres 255');
      
      $this->widgetSchema->setLabels(array(
          'comment' => 'Comentario'
      ));
  }
}
